package com.example.analysis.controller;

import com.example.analysis.entity.TeacherEvaluation;
import com.example.analysis.service.TeacherEvaluationService;
import com.example.analysis.utils.Response;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List; // 导入 List 类

@RestController
@RequestMapping("/teacher-evaluation")
@CrossOrigin
public class TeacherEvaluationController {
    @Autowired
    private TeacherEvaluationService teacherEvaluationService;

    @GetMapping("/get-all")
    public Response<List<TeacherEvaluation>> getAllEvaluations() {
        return teacherEvaluationService.getAllEvaluations();
    }

    @GetMapping("/get-by-teacher-id")
    public Response<TeacherEvaluation> getEvaluationByTeacherId(@RequestParam String teacherId) {
        return teacherEvaluationService.getEvaluationByTeacherId(teacherId);
    }
}
